package com.foreknow.demo11;

/**
 * 宠物类
 */
public abstract class Pet {
    private String name;
    private int health;
    private int love;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }

    //相当于定义一个抽象方法:只有声明,没有实现,抽象方法需要子类来实现
    //注意:类中只要有一个抽象方法或多个抽象方法,那么类一定要为抽象类
    public abstract void toHospital();
}
